SHELL=sh

cflags_common := -Wall -Wextra

CXXFLAGS := $(cflags_common) -g -O0

target = startup_debug

debug: $(target)
	@echo "compile completed in DEBUG mode"

$(target) : compile_src
	@echo "start linking"
	g++ src/obj/*.o src/uestc/obj/*.o src/wangdao/obj/*.o -o $(target) -pthread -I lib/lib/pthreads-w32-2-9-1-release/Pre-built.2/include -DHAVE_PTHREAD_H

compile_src:
	make -C src

release: CXXFLAGS = $(cflags_common) -O2
release: target = startup
release: $(target)
	@echo "compile completed in RELEASE mode"

.PHONY : compile_src clean debug release

clean:
	rm -rf *.exe
	make -C src clean

export CXXFLAGS